/*****************************************************************************
 * (C) Copyright 2013 Atech-Automotive
 * FILE NAME:    diag_Itf.c
 * DESCRIPTION:  
 * DATE BEGUN:   Feb 2013
 * BY:           Allen Feng
 * PRODUCT NAME:ZOTYE  B11 BCM
 * APPLICATION:  
 * TARGET H/W:   
 * DOC REF:
 *****************************************************************************
 */

#define diag_itf_c




/* #include */
#include "sys_micro.h"
#include "system.h"
#include "hwa_inputs.h"
#include "hwa_outputs.h"
#include "diag.h"
#include "diag_itf.h"
//#include "diag_Turn.h"
#include "diag_fun.h"
//#include "app_windows.h"


//#include "hwa_lsdArray.h"
#include "app_can_Itf.h"
#include "msg_canList.h"
#include "app_canNwm.h"
#include "app_can.h"
#include "app_canNwm.h"

/* #define */

/* Macros */

/* typedef */

/* static variables */

/* static constants */

/* static function prototypes */
/*****************************************************************************/
/**
 * Function Name: APP_TurnInterface
 * Description:  handle with APP_Turn sw module interface
 *
 * Param:   none
 * Return:  none
 * Author:  AF
 * *****************************************************************************/
void Diag_Interface(void)
{
    dtcStatus[DTCF_V_LOW].diag_In                  = ((VBATDiag.errStatusL) !=0);
//	dtcStatus[DTCF_V_LOW].status				   = VBATDiag.errStatusL;
    dtcStatus[DTCF_V_HI].diag_In                   = ((VBATDiag.errStatusH) !=0);
//	dtcStatus[DTCF_V_HI].status				       = VBATDiag.errStatusH;
//    dtcStatus[DTCF_LDoor_Short_TO_BAT].diag_In     = LLockHSDDiag.errStatus;
//    dtcStatus[DTCF_RDoor_Short_TO_BAT].diag_In     = RLockHSDDiag.errStatus ;
//    dtcStatus[DTCF_Horn_Open].diag_In              = ((HornHSDDiag.errStatus & LSD_OPEN_LOAD_ERR) !=0);
//    dtcStatus[DTCF_Horn_Short].diag_In             = ((HornHSDDiag.errStatus & LSD_BAT_ERR) !=0);

//    dtcStatus[DTCF_LWIN_Open].diag_In     = app_windowsGetDiagStatus(WIN_FL,DOWN_LOW_CURRENT_ERR);
//    dtcStatus[DTCF_LWIN_STUCK].diag_In    = app_windowsGetDiagStatus(WIN_FL,DOWN_HIGH_CURRENT_ERR); 
//    dtcStatus[DTCF_RWIN_Open].diag_In     = app_windowsGetDiagStatus(WIN_FR,DOWN_LOW_CURRENT_ERR);
//	dtcStatus[DTCF_RWIN_STUCK].diag_In    = app_windowsGetDiagStatus(WIN_FR,DOWN_HIGH_CURRENT_ERR);
 	                                          
//    dtcStatus[DTCF_RDefrost_Short_TO_BAT].diag_In  = RearDefr_LSDDiag.errStatus;

// 	dtcStatus[DTCF_BusOff].diag_In           = app_canNwm_Itf_getBusOffSts() ;//DTC_getOsekBusoffFault() ;                   
  //  dtcStatus[DTCF_Lost_BCM].diag_In         = CanMsg18FFF091_Rx.Error;       ///// make sure RX ID
  //  dtcStatus[DTCF_Lost_CCU].diag_In         = CanMsg18FFF0EE_Rx.Error;                                        
  //  dtcStatus[DTCF_Lost_ICM].diag_In         = CanMsg18FFF047_Rx.Error;                                           
}


/*****************************************************************************/
/**
 * Function Name: void clearDiagnosticsStatus(void)
 * Description:   Clear all active DTCs
 *
 * Param:   none
 * Return:  none
 * Author:  rrosenba
 *****************************************************************************/
void clearDiagnosticsStatus(void)
{

    VBATDiag.errStatusL=0;
    VBATDiag.errStatusH=0;
    TemperatureSensorDiag.errStatus=0;
//    LLockHSDDiag.errStatus=0;
//    RLockHSDDiag.errStatus=0;
//    HornHSDDiag.errStatus=0;
//    RearDefr_LSDDiag.errStatus=0;
//   app_windowsClrDiagStatus();
//    appCanNwm_clearNwmDTC();
//    CanMsg18FFF091_Rx.Error=0;
 //   CanMsg18FFF0EE_Rx.Error=0;
 //   CanMsg18FFF047_Rx.Error=0;
    /* clear error status bytes generated within this src file */
/*    VBATHSDDiag.errStatus = 0;  
    parklightHSDDiag.errStatus = 0;
    breaklightHSDDiag.errStatus =0;
    RwasherHSDDiag.errStatus = 0;
    FwasherHSDDiag.errStatus = 0;
    VBATHSDDiag.errStatus = 0;  
    RwasherRelayDiag.errStatus = 0;
    FwasherRelayDiag.errStatus = 0;
    RfogRelayDiag.errStatus = 0;
    DRLRelayDiag.errStatus = 0;
    R_WIPWERRelayDiag.errStatus = 0;
    WIPWER_HIGHRelayDiag.errStatus = 0;
    WIPWER_LOWRelayDiag.errStatus = 0;
    ESCLRelayDiag.errStatus = 0;
    TRUNKRelayDiag.errStatus = 0;   
    DOME_LSDDiag.errStatus = 0;
    R_WIPER_REDiag.errStatus = 0;
    F_WIPER_REDiag.errStatus = 0;
    HIGHBEAM_LSDDiag.errStatus = 0;
    LOWBEAM_LSDDiag.errStatus = 0;
    HORN_LSDDiag.errStatus = 0;
    FL_WIN_UP_LSDDiag.errStatus = 0;
    FR_WIN_UP_LSDDiag.errStatus = 0;
    RL_WIN_UP_LSDDiag.errStatus = 0;
    RR_WIN_UP_LSDDiag.errStatus = 0;
    FL_WIN_DN_LSDDiag.errStatus = 0;
    FR_WIN_DN_LSDDiag.errStatus = 0;
    RL_WIN_DN_LSDDiag.errStatus = 0;
    RR_WIN_DN_LSDDiag.errStatus = 0; 
    F_FOG_LSDDiag.errStatus = 0;
    IGN2_LSDDiag.errStatus = 0;
    IGN1_LSDDiag.errStatus = 0;
    ACC_LSDDiag.errStatus = 0;    
    MIR_FOLD_LSDDiag.errStatus = 0;
    MIR_UNFOLD_LSDDiag.errStatus = 0;
    app_clearcan0ICbreakdwonError();
//  app_can0ClearAllError();
    Can0Msg118_Rx.Error = 0;
    app_can1ClearAllError();
    appCanNwm_clearNwmDTC();
    APP_TurnClearDTC();
    clearLSDArrayDiag();
    APP_TurnClearDTC();               */

   
}

